from selenium.webdriver import Chrome
import time
from chaojiying import Chaojiying_Client

web = Chrome()
web.get("https://www.chaojiying.com/user/login/")

img_el = web.find_element_by_xpath('/html/body/div[3]/div/div[3]/div[1]/form/div/img').screenshot_as_png
# 处理验证码
chaojiying = Chaojiying_Client('18875767707', '18875767707', '916714')
dic = chaojiying.PostPic(img_el,1902)
print(dic)
code = dic["pic_str"]
print(code)
time.sleep(2)

web.find_element_by_xpath('/html/body/div[3]/div/div[3]/div[1]/form/p[1]/input').send_keys("18875767707")
web.find_element_by_xpath('/html/body/div[3]/div/div[3]/div[1]/form/p[2]/input').send_keys("18875767707")
time.sleep(1)
web.find_element_by_xpath('/html/body/div[3]/div/div[3]/div[1]/form/p[3]/input').send_keys(code)
time.sleep(1)
web.find_element_by_xpath('/html/body/div[3]/div/div[3]/div[1]/form/p[4]/input').click()


